package ec.atreasure.com.core.fragments.bottom;

import android.widget.Toast;

import ec.atreasure.com.core.R;
import ec.atreasure.com.core.app.Atreasure;
import ec.atreasure.com.core.fragments.AtreasureFragment;

/**
 * Description :首页导航栏底部item基类
 * Created by wangjin on 2019/7/6.
 * Job number：
 * Phone ：18301070822
 * Email： 120182051@qq.com
 * Person in charge : 汪渝栋
 * Leader：
 */
public abstract class BottomItemFragment extends AtreasureFragment {

    private static final long WAIT_TIME = 2000L;

    private long TOUCH_TIME = 0;

    @Override
    public boolean onBackPressedSupport() {
        if (System.currentTimeMillis() - TOUCH_TIME < WAIT_TIME) {
            _mActivity.finish();
        } else {
            TOUCH_TIME = System.currentTimeMillis();
            Toast.makeText(_mActivity, "双击退出" + Atreasure.getApplicationContext().getString(R.string.app_name), Toast.LENGTH_SHORT).show();
        }
        return true;
    }
}
